<html>
<title>SSH desktop</title>

<body id="applet-container">
</body>

<script>

    var request =
    {
        QueryString : function(val)
        {
            var uri = window.location.search;
            var re = new RegExp("" +val+ "=([^&?]*)", "ig");
            return ((uri.match(re))?(uri.match(re)[0].substr(val.length+1)):null);
        }
    }

    sleep = function(milliSeconds) {
        var startTime = new Date().getTime(); // get the current time
        while (new Date().getTime() < startTime + milliSeconds); // hog cpu
    };

    sleep(3500);

    host = request.QueryString("host");
    port = request.QueryString("port");
    username = request.QueryString("username");
    password = request.QueryString("password");

    var container = document.getElementById("applet-container");

    var str = "<applet archive=\"jcterm.jar,jsch-0.1.50.jar\" code=\"com.jcraft.jcterm.JCTermApplet.class\" width=\"100%\" height=\"100%\">";
    str += "<param name=\"address\" value=\"" + host + "\" />";
    str += "<param name=\"port\" value=\"" + port + "\" />";
    str += "<param name=\"username\" value=\"" + username + "\" />";
    str += "<param name=\"password\" value=\"" + password + "\" />";
    str += "</applet>";

    container.innerHTML = str;

</script>
</html>